package com.hison.courseselectionsystem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hison.courseselectionsystem.domain.CourseTeacher;
import com.hison.courseselectionsystem.mapper.CourseTeacherMapper;
import com.hison.courseselectionsystem.service.CourseTeacherService;
import com.hison.courseselectionsystem.utils.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author hison
 * @description 针对表【course_teacher】的数据库操作Service实现
 * @createDate 2023-11-16 21:53:51
 */
@Service
public class CourseTeacherServiceImpl extends ServiceImpl<CourseTeacherMapper, CourseTeacher> implements CourseTeacherService {

    @Resource
    private CourseTeacherMapper courseTeacherMapper;

    @Override
    public Result add(Integer teacherId, Integer courseId) {
        courseTeacherMapper.insert(new CourseTeacher(teacherId, courseId));
        return Result.ok("添加成功");
    }

    @Override
    public Result getStudent(Integer teacherId) {
        //TODO
        return Result.fail("方法待实现");
    }

    @Override
    public Result getStudentlist(Integer courseid, String teacherid) {
        //TODO 获取选了自己教的课的学生
        return Result.fail("方法待实现");
    }
}
